package com.meizi.core.tool.exception;

import com.meizi.core.tool.status.IStatus;
import lombok.Data;

/**
 * @author meizi
 * @email enjoymeizi@gmail.com
 * @date 2020/11/26 13:47
 */
@Data
public class BaseException extends RuntimeException {
    protected String code;
    protected String msg;

    public BaseException() {
        super();
    }

    public BaseException(String message) {
        super(message);
        this.msg = message;
    }

    public BaseException(String code, String msg) {
        super();
        this.code = code;
        this.msg = msg;
    }

    public BaseException(IStatus status) {
        super(status.getMsg());
        this.code = String.valueOf(status.getCode());
        this.msg = status.getMsg();
    }
}
